//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using DucLinhControls;
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing.Imaging;
			using System.Drawing.Printing;
			using System.Drawing;
			using System.IO;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			using Utility;
			// Warning -- Type: DucLinhControls.PictureBox conflicts with a another imported type or namespace name,  Disabled Using Ref --> using PictureBox = DucLinhControls.PictureBox;
			
		#endregion
		
	public class frmCapNhatAnh : Form
	
	{
		
		#region Fields
			private string _clrISN;
			private string _NgayKham;
			private ArrayList arrDescription;
			private ArrayList arrISN;
			private ArrayList arrPicPath;
			private ArrayList arrPictureStatus;
			private Button btAddPic;
			private Button btBrowse;
			private Button btCapNhat;
			private Button btNext;
			private Button btPrevious;
			private Button btPrint;
			private Button btThoat;
			private Button btXoa;
			private ComboBox cbPictureStatus;
			private IContainer components;
			private string connStr;
			private Database_Com db;
			private string ext;
			public int flag;
			private GroupBox groupBox1;
			private ImageList imageList1;
			private int index;
			private Label label1;
			private Label label2;
			private Label lbNgayKham;
			private Bitmap MyImage;
			private string path;
			private DucLinhControls.PictureBox picPatient;
			private TextBox tbMoTa;
			private ToolTip toolTip1;
		#endregion
		
		#region Constructors
		
			public frmCapNhatAnh (string clrISN, string NgayKham)
			
			{
				this.db = new Database_Com ();
				this.arrPicPath = new ArrayList ();
				this.arrDescription = new ArrayList ();
				this.arrISN = new ArrayList ();
				this.arrPictureStatus = new ArrayList ();
				this.flag = 1;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				this._clrISN = clrISN;
				this._NgayKham = NgayKham;
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btAddPic_Click (object sender, EventArgs e)
			
			{
				MemoryStream theMemoryStream;
				byte[] theByteArray;
				int i;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (this.tbMoTa.Text != "")
				{
					goto L_002F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng nh?p m? t?", "L?i nh?p", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_01DD;
				
			L_002F:
				
				{
				}
				if (this.picPatient.Image != null)
				{
					goto L_0054;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui l?ng ch?n ?nh", "L?i nh?p", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_01DD;
				
			L_0054:
				try
				{
					theMemoryStream = new MemoryStream ();
					this.picPatient.Image.Save (((Stream) theMemoryStream), this.picPatient.Image.RawFormat);
					theByteArray = theMemoryStream.GetBuffer ();
					theMemoryStream.Close ();
					i = 0;
					if (this.cbPictureStatus.SelectedItem.ToString () != "Tai, M?i xoang")
					{
						goto L_00AA;
					}
					i = 0;
					goto L_00C8;
					
				L_00AA:
					
					{
					}
					if (this.cbPictureStatus.SelectedItem.ToString () != "V?m h?ng, H?ng-H? h?ng, Thanh qu?n")
					{
						goto L_00C8;
					}
					i = 1;
					
				L_00C8:
					
					{
					}
					SqlConnection theSqlConnection = this.db.CreateConnections ();
					theStringArray = new string[5];
					theStringArray[0] = "@clrISN";
					theStringArray[1] = "@scpPicture";
					theStringArray[2] = "@scpNote";
					theStringArray[3] = "@scpImage";
					theStringArray[4] = "@scpPictureStatus";
					theSqlDbTypeArray = new SqlDbType[5];
					theSqlDbTypeArray[0] = SqlDbType.Int;
					theSqlDbTypeArray[1] = SqlDbType.NVarChar;
					theSqlDbTypeArray[2] = SqlDbType.NVarChar;
					theSqlDbTypeArray[3] = SqlDbType.Image;
					theSqlDbTypeArray[4] = SqlDbType.Int;
					theObjectArray = new object[5];
					theObjectArray[0] = this._clrISN;
					theObjectArray[1] = "";
					theObjectArray[2] = this.tbMoTa.Text.ToString ();
					theObjectArray[3] = theByteArray;
					theObjectArray[4] = i;
					this.db.ExecuteStoredProc ("sp_ScanPicture_Insert", theStringArray, theSqlDbTypeArray, theObjectArray);
					this.arrPicPath.Clear ();
					this.arrDescription.Clear ();
					this.arrISN.Clear ();
					this.tbMoTa.Text = "";
					this.frmCapNhatAnh_Load (sender, e);
					DialogResult theDialogResult3 = MessageBox.Show ("?nh ?? ???c l?u", "Ch?n H?nh", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				catch
				{
					
				L_01C7:
					
					{
					}
					DialogResult theDialogResult4 = MessageBox.Show ("Vui l?ng ch?n ?nh", "L?i Nh?p", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				}
				
			L_01DD:
				return;
			}
			
			private void btBrowse_Click (object sender, EventArgs e)
			
			{
				OpenFileDialog theOpenFileDialog;
				theOpenFileDialog = new OpenFileDialog ();
				theOpenFileDialog.Filter = "JPEG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif|Bitmap Files (*.bmp)|*.bmp";
				theOpenFileDialog.FilterIndex = 1;
				theOpenFileDialog.RestoreDirectory = true;
				if (theOpenFileDialog.ShowDialog () != DialogResult.OK)
				{
					goto L_0064;
				}
				if (this.MyImage == null)
				{
					goto L_003B;
				}
				this.MyImage.Dispose ();
				
			L_003B:
				
				{
				}
				this.MyImage = new Bitmap (theOpenFileDialog.FileName);
				this.picPatient.Image = ((Image) this.MyImage);
				this.MyImage = ((Bitmap) null);
				
			L_0064:
				return;
			}
			
			private void btCapNhat_Click (object sender, EventArgs e)
			
			{
				MemoryStream theMemoryStream;
				byte[] theByteArray;
				int i;
				Exception theException;
				int i2;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				string[] theStringArray2;
				SqlDbType[] theSqlDbTypeArray2;
				object[] theObjectArray2;
				if (this.tbMoTa.Text != "")
				{
					goto L_002F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng nh?p m? t?", "L?i nh?p", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				goto L_0329;
				
			L_002F:
				
				{
				}
				if (this.picPatient.Image != null)
				{
					goto L_0054;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui l?ng ch?n ?nh", "L?i Nh?p", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_0329;
				
			L_0054:
				try
				{
					theMemoryStream = new MemoryStream ();
					this.picPatient.Image.Save (((Stream) theMemoryStream), this.picPatient.Image.RawFormat);
					theByteArray = theMemoryStream.GetBuffer ();
					theMemoryStream.Close ();
					i = 0;
					if (this.cbPictureStatus.SelectedItem.ToString () != "Tai, M?i xoang")
					{
						goto L_00AA;
					}
					i = 0;
					goto L_00C8;
					
				L_00AA:
					
					{
					}
					if (this.cbPictureStatus.SelectedItem.ToString () != "V?m h?ng, H?ng-H? h?ng, Thanh qu?n")
					{
						goto L_00C8;
					}
					i = 1;
					
				L_00C8:
					
					{
					}
					SqlConnection theSqlConnection = this.db.CreateConnections ();
					theStringArray = new string[5];
					theStringArray[0] = "@scpISN";
					theStringArray[1] = "@scpPicture";
					theStringArray[2] = "@scpNote";
					theStringArray[3] = "@scpImage";
					theStringArray[4] = "@scpPictureStatus";
					theSqlDbTypeArray = new SqlDbType[5];
					theSqlDbTypeArray[0] = SqlDbType.Int;
					theSqlDbTypeArray[1] = SqlDbType.NVarChar;
					theSqlDbTypeArray[2] = SqlDbType.NVarChar;
					theSqlDbTypeArray[3] = SqlDbType.Image;
					theSqlDbTypeArray[4] = SqlDbType.Int;
					theObjectArray = new object[5];
					theObjectArray[0] = this.arrPicPath[this.index].ToString ();
					theObjectArray[1] = "";
					theObjectArray[2] = this.tbMoTa.Text.ToString ();
					theObjectArray[3] = theByteArray;
					theObjectArray[4] = i;
					this.db.ExecuteStoredProc ("sp_ScanPicture_Update", theStringArray, theSqlDbTypeArray, theObjectArray);
					this.arrPicPath.Clear ();
					this.arrDescription.Clear ();
					this.arrISN.Clear ();
					this.tbMoTa.Text = "";
					this.frmCapNhatAnh_Load (sender, e);
					DialogResult theDialogResult3 = MessageBox.Show ("?nh ?? ???c l?u", "Ch?n H?nh", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				catch (Exception theException2)
				{
					
				L_01E1:
					theException = theException2;
					i2 = 0;
					if (this.cbPictureStatus.SelectedItem.ToString () != "Tai, M?i xoang")
					{
						goto L_0206;
					}
					i2 = 0;
					goto L_0225;
					
				L_0206:
					
					{
					}
					if (this.cbPictureStatus.SelectedItem.ToString () != "V?m h?ng, H?ng-H? h?ng, Thanh qu?n")
					{
						goto L_0225;
					}
					i2 = 1;
					
				L_0225:
					
					{
					}
					SqlConnection theSqlConnection2 = this.db.CreateConnections ();
					theStringArray2 = new string[4];
					theStringArray2[0] = "@scpISN";
					theStringArray2[1] = "@scpPicture";
					theStringArray2[2] = "@scpNote";
					theStringArray2[3] = "@scpPictureStatus";
					theSqlDbTypeArray2 = new SqlDbType[4];
					theSqlDbTypeArray2[0] = SqlDbType.Int;
					theSqlDbTypeArray2[1] = SqlDbType.NVarChar;
					theSqlDbTypeArray2[2] = SqlDbType.NVarChar;
					theSqlDbTypeArray2[3] = SqlDbType.Int;
					theObjectArray2 = new object[4];
					theObjectArray2[0] = this.arrPicPath[this.index].ToString ();
					theObjectArray2[1] = "";
					theObjectArray2[2] = this.tbMoTa.Text.ToString ();
					theObjectArray2[3] = i2;
					this.db.ExecuteStoredProc ("sp_ScanPictureNoPicture_Update", theStringArray2, theSqlDbTypeArray2, theObjectArray2);
					this.arrPicPath.Clear ();
					this.arrDescription.Clear ();
					this.arrISN.Clear ();
					this.tbMoTa.Text = "";
					this.frmCapNhatAnh_Load (sender, e);
					DialogResult theDialogResult4 = MessageBox.Show ("?nh ?? ???c l?u", "Ch?n H?nh", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				
			L_0329:
				return;
			}
			
			private void btNext_Click (object sender, EventArgs e)
			
			{
				this.index++;
				this.LoadPicture ();
				return;
			}
			
			private void btNext_MouseHover (object sender, EventArgs e)
			
			{
				return;
			}
			
			private void btNext_MouseLeave (object sender, EventArgs e)
			
			{
				return;
			}
			
			private void btPrevious_Click (object sender, EventArgs e)
			
			{
				this.index--;
				this.LoadPicture ();
				return;
			}
			
			private void btPrevious_MouseHover (object sender, EventArgs e)
			
			{
				return;
			}
			
			private void btPrevious_MouseLeave (object sender, EventArgs e)
			
			{
				return;
			}
			
			private void btPrint_Click (object sender, EventArgs e)
			
			{
				PrintDocument thePrintDocument;
				PrintDialog thePrintDialog;
				if (this.picPatient.Image == null)
				{
					goto L_0059;
				}
				thePrintDocument = new PrintDocument ();
				thePrintDialog = new PrintDialog ();
				thePrintDialog.Document = thePrintDocument;
				DialogResult theDialogResult = thePrintDialog.ShowDialog ();
				
			L_0027:
				try
				{
					thePrintDocument.PrintPage += new PrintPageEventHandler (this.pd_PrintPage);
					thePrintDocument.Print ();
				}
				catch
				{
					
				L_0041:
					
					{
					}
					DialogResult theDialogResult2 = MessageBox.Show ("Qu? tr?nh in ?nh ?? ???c hu?", "H?y In ?nh", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				
			L_0057:
				
				{
				}
				goto L_006C;
				
			L_0059:
				
				{
				}
				DialogResult theDialogResult3 = MessageBox.Show ("Vui l?ng ch?n ?nh", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				
			L_006C:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btXoa_Click (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				int i = this.db.Excu_NonQuery (string.Concat ("Delete ScanPicture Where scpISN=", this.arrPicPath[this.index].ToString ()));
				this.arrPicPath.Clear ();
				this.arrDescription.Clear ();
				this.arrISN.Clear ();
				this.tbMoTa.Text = "";
				this.frmCapNhatAnh_Load (sender, e);
				DialogResult theDialogResult = MessageBox.Show ("?nh ?? xo? l?u", "Xo? H?nh", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmCapNhatAnh_Load (object sender, EventArgs e)
			
			{
				string theString;
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				int i;
				this.index = 0;
				theString = this._clrISN;
				this.cbPictureStatus.SelectedIndex = 0;
				if (theString == string.Empty)
				{
					goto L_01E2;
				}
				this.lbNgayKham.Text = this._NgayKham;
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter (string.Concat ("SELECT * FROM ScanPicture WHERE clrISN=", theString), theSqlConnection);
				theDataSet = new DataSet ();
				int i2 = theSqlDataAdapter.Fill (theDataSet, "ScanPicture");
				if (theDataSet == null)
				{
					goto L_01E2;
				}
				
			L_0074:
				
				{
				}
				i = 0;
				goto L_014A;
				
			L_007C:
				
				{
				}
				int i3 = this.arrISN.Add (theDataSet.Tables[0].Rows[i][0].ToString ());
				int i4 = this.arrDescription.Add (theDataSet.Tables[0].Rows[i]["scpNote"].ToString ());
				int i5 = this.arrPicPath.Add (theDataSet.Tables[0].Rows[i]["scpISN"].ToString ());
				int i6 = this.arrPictureStatus.Add (theDataSet.Tables[0].Rows[i]["scpPictureStatus"].ToString ());
				i++;
				
			L_014A:
				
				{
				}
				if (i < theDataSet.Tables[0].Rows.Count)
				{
					goto L_007C;
				}
				if ((this.arrISN.Count != 0) && (this.arrISN.Count != 1))
				{
					goto L_019C;
				}
				
			L_0182:
				
				{
				}
				this.btNext.Enabled = false;
				this.btPrevious.Enabled = false;
				goto L_01B4;
				
			L_019C:
				
				{
				}
				this.btNext.Enabled = true;
				this.btPrevious.Enabled = true;
				
			L_01B4:
				
				{
				}
				if (this.arrISN.Count <= 0)
				{
					goto L_01D6;
				}
				this.LoadPicture ();
				this.btCapNhat.Enabled = true;
				goto L_01E2;
				
			L_01D6:
				
				{
				}
				this.btCapNhat.Enabled = false;
				
			L_01E2:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				object[] theObjectArray;
				Control[] theControlArray2;
				this.components = ((IContainer) new System.ComponentModel.Container ());
				theResourceManager = new ResourceManager (typeof (frmCapNhatAnh));
				this.btThoat = new Button ();
				this.btBrowse = new Button ();
				this.lbNgayKham = new Label ();
				this.toolTip1 = new ToolTip (this.components);
				this.btNext = new Button ();
				this.btPrevious = new Button ();
				this.btPrint = new Button ();
				this.imageList1 = new ImageList (this.components);
				this.label1 = new Label ();
				this.tbMoTa = new TextBox ();
				this.label2 = new Label ();
				this.btAddPic = new Button ();
				this.btCapNhat = new Button ();
				this.groupBox1 = new GroupBox ();
				this.picPatient = new DucLinhControls.PictureBox ();
				this.cbPictureStatus = new ComboBox ();
				this.btXoa = new Button ();
				this.groupBox1.SuspendLayout ();
				base.SuspendLayout ();
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Location = new Point (232, 16);
				this.btThoat.Name = "btThoat";
				this.btThoat.Size = new System.Drawing.Size (56, 23);
				this.btThoat.TabIndex = 18;
				this.btThoat.Text = "Tho?t";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.btBrowse.FlatStyle = FlatStyle.Popup;
				this.btBrowse.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.btBrowse.Location = new Point (284, 336);
				this.btBrowse.Name = "btBrowse";
				this.btBrowse.Size = new System.Drawing.Size (32, 23);
				this.btBrowse.TabIndex = 16;
				this.btBrowse.Text = "...";
				this.toolTip1.SetToolTip (((Control) this.btBrowse), "Ch?n ?nh");
				this.btBrowse.Click += new EventHandler (this.btBrowse_Click);
				this.lbNgayKham.BorderStyle = BorderStyle.Fixed3D;
				this.lbNgayKham.Location = new Point (104, 48);
				this.lbNgayKham.Name = "lbNgayKham";
				this.lbNgayKham.Size = new System.Drawing.Size (176, 23);
				this.lbNgayKham.TabIndex = 19;
				this.btNext.FlatStyle = FlatStyle.Popup;
				this.btNext.Location = new Point (168, 336);
				this.btNext.Name = "btNext";
				this.btNext.Size = new System.Drawing.Size (32, 24);
				this.btNext.TabIndex = 23;
				this.toolTip1.SetToolTip (((Control) this.btNext), "?nh Ti?p Theo");
				this.btNext.Click += new EventHandler (this.btNext_Click);
				this.btNext.MouseHover += new EventHandler (this.btNext_MouseHover);
				this.btNext.MouseLeave += new EventHandler (this.btNext_MouseLeave);
				this.btPrevious.FlatStyle = FlatStyle.Popup;
				this.btPrevious.Location = new Point (128, 336);
				this.btPrevious.Name = "btPrevious";
				this.btPrevious.Size = new System.Drawing.Size (32, 23);
				this.btPrevious.TabIndex = 24;
				this.toolTip1.SetToolTip (((Control) this.btPrevious), "?nh Tr??c");
				this.btPrevious.Click += new EventHandler (this.btPrevious_Click);
				this.btPrevious.MouseHover += new EventHandler (this.btPrevious_MouseHover);
				this.btPrevious.MouseLeave += new EventHandler (this.btPrevious_MouseLeave);
				this.btPrint.FlatStyle = FlatStyle.Popup;
				this.btPrint.Image = ((Image) ((Bitmap) theResourceManager.GetObject ("btPrint.Image")));
				this.btPrint.Location = new Point (292, 48);
				this.btPrint.Name = "btPrint";
				this.btPrint.Size = new System.Drawing.Size (24, 24);
				this.btPrint.TabIndex = 26;
				this.toolTip1.SetToolTip (((Control) this.btPrint), "In ?nh");
				this.btPrint.Click += new EventHandler (this.btPrint_Click);
				this.imageList1.ColorDepth = ColorDepth.Depth8Bit;
				this.imageList1.ImageSize = new System.Drawing.Size (16, 16);
				this.imageList1.ImageStream = ((ImageListStreamer) theResourceManager.GetObject ("imageList1.ImageStream"));
				this.imageList1.TransparentColor = Color.Transparent;
				this.label1.Location = new Point (16, 16);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (48, 23);
				this.label1.TabIndex = 20;
				this.label1.Text = "M? t?:";
				this.tbMoTa.BorderStyle = BorderStyle.FixedSingle;
				this.tbMoTa.Location = new Point (76, 16);
				this.tbMoTa.Name = "tbMoTa";
				this.tbMoTa.Size = new System.Drawing.Size (240, 22);
				this.tbMoTa.TabIndex = 21;
				this.tbMoTa.Text = "";
				this.label2.Location = new Point (16, 48);
				this.label2.Name = "label2";
				this.label2.TabIndex = 22;
				this.label2.Text = "Ng?y kh?m:";
				this.btAddPic.FlatStyle = FlatStyle.Popup;
				this.btAddPic.Location = new Point (8, 16);
				this.btAddPic.Name = "btAddPic";
				this.btAddPic.Size = new System.Drawing.Size (80, 23);
				this.btAddPic.TabIndex = 25;
				this.btAddPic.Text = "Ch?n ?nh";
				this.btAddPic.Click += new EventHandler (this.btAddPic_Click);
				this.btCapNhat.FlatStyle = FlatStyle.Popup;
				this.btCapNhat.Location = new Point (96, 16);
				this.btCapNhat.Name = "btCapNhat";
				this.btCapNhat.Size = new System.Drawing.Size (72, 23);
				this.btCapNhat.TabIndex = 27;
				this.btCapNhat.Text = "C?p Nh?t";
				this.btCapNhat.Click += new EventHandler (this.btCapNhat_Click);
				theControlArray = new Control[4];
				theControlArray[0] = ((Control) this.btXoa);
				theControlArray[1] = ((Control) this.btAddPic);
				theControlArray[2] = ((Control) this.btCapNhat);
				theControlArray[3] = ((Control) this.btThoat);
				this.groupBox1.Controls.AddRange (theControlArray);
				this.groupBox1.FlatStyle = FlatStyle.Flat;
				this.groupBox1.Location = new Point (16, 360);
				this.groupBox1.Name = "groupBox1";
				this.groupBox1.Size = new System.Drawing.Size (300, 48);
				this.groupBox1.TabIndex = 29;
				this.groupBox1.TabStop = false;
				this.picPatient.BackColor = SystemColors.ActiveCaptionText;
				this.picPatient.BorderStyle = BorderStyle.FixedSingle;
				this.picPatient.Location = new Point (16, 80);
				this.picPatient.Name = "picPatient";
				this.picPatient.Size = new System.Drawing.Size (300, 250);
				this.picPatient.TabIndex = 30;
				this.picPatient.TabStop = false;
				theObjectArray = new object[2];
				theObjectArray[0] = "Tai, M?i xoang";
				theObjectArray[1] = "V?m h?ng, H?ng-H? h?ng, Thanh qu?n";
				this.cbPictureStatus.Items.AddRange (theObjectArray);
				this.cbPictureStatus.Location = new Point (16, 336);
				this.cbPictureStatus.Name = "cbPictureStatus";
				this.cbPictureStatus.Size = new System.Drawing.Size (88, 22);
				this.cbPictureStatus.TabIndex = 31;
				this.btXoa.FlatStyle = FlatStyle.Popup;
				this.btXoa.Location = new Point (176, 16);
				this.btXoa.Name = "btXoa";
				this.btXoa.Size = new System.Drawing.Size (48, 24);
				this.btXoa.TabIndex = 28;
				this.btXoa.Text = "Xo?";
				this.btXoa.Click += new EventHandler (this.btXoa_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 15);
				base.ClientSize = new System.Drawing.Size (330, 419);
				theControlArray2 = new Control[11];
				theControlArray2[0] = ((Control) this.cbPictureStatus);
				theControlArray2[1] = ((Control) this.picPatient);
				theControlArray2[2] = ((Control) this.groupBox1);
				theControlArray2[3] = ((Control) this.btPrint);
				theControlArray2[4] = ((Control) this.btPrevious);
				theControlArray2[5] = ((Control) this.btNext);
				theControlArray2[6] = ((Control) this.lbNgayKham);
				theControlArray2[7] = ((Control) this.label2);
				theControlArray2[8] = ((Control) this.tbMoTa);
				theControlArray2[9] = ((Control) this.label1);
				theControlArray2[10] = ((Control) this.btBrowse);
				base.Controls.AddRange (theControlArray2);
				this.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmCapNhatAnh";
				base.StartPosition = FormStartPosition.CenterParent;
				this.Text = "C?p Nh?t ?nh";
				base.Load += new EventHandler (this.frmCapNhatAnh_Load);
				this.groupBox1.ResumeLayout (false);
				base.ResumeLayout (false);
				return;
			}
			
			private void LoadPicture ()
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				byte[] theByteArray;
				MemoryStream theMemoryStream;
				if (this.arrPicPath.Count != 1)
				{
					goto L_001C;
				}
				this.btPrevious.Enabled = false;
				goto L_0086;
				
			L_001C:
				
				{
				}
				if (this.index != (this.arrPicPath.Count - 1))
				{
					goto L_004B;
				}
				this.btNext.Enabled = false;
				this.btPrevious.Enabled = true;
				goto L_0086;
				
			L_004B:
				
				{
				}
				if (this.index > 0)
				{
					goto L_006E;
				}
				this.btPrevious.Enabled = false;
				this.btNext.Enabled = true;
				goto L_0086;
				
			L_006E:
				
				{
				}
				this.btPrevious.Enabled = true;
				this.btNext.Enabled = true;
				
			L_0086:
				
				{
				}
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter (string.Concat ("SELECT * FROM ScanPicture WHERE scpISN=", this.arrPicPath[this.index].ToString ()), theSqlConnection);
				theDataSet = new DataSet ();
				int i = theSqlDataAdapter.Fill (theDataSet, "ScanPicture");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_00F9;
				}
				
			L_00F4:
				
				{
				}
				goto L_01D4;
				
			L_00F9:
				
				{
				}
				this.tbMoTa.Text = this.arrDescription[this.index].ToString ();
				if (this.arrPictureStatus[this.index].ToString () != "0")
				{
					goto L_014E;
				}
				this.cbPictureStatus.SelectedItem = "Tai, M?i xoang";
				goto L_0180;
				
			L_014E:
				
				{
				}
				if (this.arrPictureStatus[this.index].ToString () != "1")
				{
					goto L_0180;
				}
				this.cbPictureStatus.SelectedItem = "V?m h?ng, H?ng-H? h?ng, Thanh qu?n";
				
			L_0180:
				
				{
				}
				theByteArray = ((byte[]) theDataSet.Tables[0].Rows[0]["scpImage"]);
				theMemoryStream = new MemoryStream (theByteArray);
				this.picPatient.Image = Image.FromStream (((Stream) theMemoryStream));
				theMemoryStream.Close ();
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				
			L_01D4:
				return;
			}
			
			private void pd_PrintPage (object sender, PrintPageEventArgs e)
			
			{
				Rectangle theRectangle;
				System.Drawing.Size theSize;
				float theSingle;
				theRectangle = e.PageBounds;
				theSingle = Math.Min ((300F / ((float) (theSize = this.picPatient.Image.Size).Width)), (300F / ((float) theSize.Height)));
				e.Graphics.DrawImage (this.picPatient.Image, (((float) theRectangle.X) + ((((float) theRectangle.Width) - (((float) theSize.Width) * theSingle)) / 2F)), (((float) theRectangle.Y) + ((((float) theRectangle.Height) - (((float) theSize.Height) * theSingle)) / 2F)), (((float) theSize.Width) * theSingle), (((float) theSize.Height) * theSingle));
				e.HasMorePages = false;
				return;
			}
			
		#endregion
	}
	
}

